package mapping

import (
	"maya-service/model"
	"maya-service/model/entity"
)

// DictionaryItemsEntityToDto entity data transfer
func DictionaryItemsEntityToDto(dictionaryItems []*entity.DictionaryItem) []*model.DictionaryItemInfo {
	out := make([]*model.DictionaryItemInfo, 0, len(dictionaryItems))
	for _, c := range dictionaryItems {
		out = append(out, DictionaryItemEntityToDto(c))
	}
	return out
}

// DictionaryItemEntityToDto entity data transfer
func DictionaryItemEntityToDto(e *entity.DictionaryItem) *model.DictionaryItemInfo {
	return &model.DictionaryItemInfo{

		Id: e.Id,

		Code: e.Code,

		Key: e.Key,

		Value: e.Value,

		Status: e.Status,

		SortOrder: e.SortOrder,

		Description: e.Description,

		CreatedAt: e.CreatedAt,

		UpdatedAt: e.UpdatedAt,
	}
}
